﻿@model RecipientInfoVM
<div class="panel @(Model.IsDefault ? "panel-primary":"panel-default")" id="@($"container{Model.Id}")">
    <div class="panel-heading">
        收件人：@Model.Recipient
    </div>
    <div class="panel-body">
        <ul class="list-unstyled">
            <li>@Model.ProvinceName @Model.CityName @Model.DistrictName @Model.Address</li>
            <li>手机：@Model.Mobile</li>       
            <li>电话：@Model.Phone</li>          
            <li>邮编：@Model.Postcode</li>
        </ul>

    </div>
    <div class="panel-footer">
        @if (!Model.IsDefault)       
        {
            <a href="#" data-url="@Url.Action("IsDefault", new {id = Model.Id})" class="btn btn-default btn-sm default-item">
                <i class="fa fa-check text-danger"></i> 默认
            </a>
        }

        @Ajax.RawActionLink("<i class='fa fa-edit'></i> 编辑",
                        "Edit", "RecipientInfo",
                        new { id = Model.Id },
                        new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "edit-container", OnComplete = "onAjaxComplete", OnSuccess = "OnSuccessLink" },
                        new { @class = "btn btn-primary btn-sm", title = Buttons.Edit })

        <a href="#" data-url="@Url.Action("Delete", new {id = Model.Id})" class="btn btn-danger btn-sm delete-item" title="@Buttons.Delete">
            <i class="fa fa-trash-o"></i> 删除
        </a>
    </div>
</div>